<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Menutab_model extends CI_Model{
	
	var	$table				=	"prices";
	var $table_country		=	"country";
	var $table_customers	=	"customers";
	var	$table_apply		=	"apply";
	var $table_page			=	"page";
	var $table_faqs			=	"faq";
	
	function __construct(){
        parent::__construct(); 
    }
    
    function get_country($letter){
    	$country	=	$this->db->select('name')
    							 ->where('LEFT(`name`, 1) =', $letter)
    							 ->get($this->table_country)
    							 ->result();
    	return $country;
    }
    
    function get_page_info($title){
    	$page_info	=	$this->db->select()
    							 ->where('title', $title)
    							 ->get($this->table_page)
    							 ->row_array();
    	if(!empty($page_info)){
    		return $page_info;
    	}
    	return false; 
    }
    
    
    function get_fees(){
    	$fees	=	$this->db->select()
    						 ->get($this->table)
    						 ->result();
    	if(!empty($fees)){
    		return $fees;
    	}
    	return false;
    }

	
    function check_status($order_id){
    	$status		=	$this->db->select('id, status')
    							 ->where('id', $order_id)
    	   						 ->get($this->table_customers)
    	   						 ->row_array();
    	if(!empty($status)){
    		return $status;
    	}
    	return false;
    }
    
    
    #get faqs for "how to apply" page.
    function get_faqs(){
    	$faqs	=	$this->db->select()
    						 ->order_by('order', 'ASC')
    						 ->limit(6)
    						 ->get($this->table_faqs)
    						 ->result();
    	if(!empty($faqs)){
    		return $faqs;
    	}
    	return false;
    }
    
}
/* End of file menutab_model.php */
/* Location: ./application/models/menu_model.php */